<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>用户编码demo</title>
		<style type="text/css">
		</style>
		<script src="../jquery-1.8.3.min.js"></script>
		<script>
			//不用写;
			var url="http://localhost:8091/getAll"
			var data="id=100&name=Tom"
			$.get(url,data,function(data){
				/* console.log(data)
				for(){
					console.log(data[i])
				}
				for(var index in data){
					console.log(data[index])
				}*/
				for(var i=0;i<data.length;i++){
					var tr=`<tr align="center">
								<td>${data[i].id}</td>
								<td>${data[i].name}</td>
								<td>${data[i].age}</td>
								<td>${data[i].sex}</td>
								<td>
									<button >修改</button>
									<button>删除</button>
								</td>
							</tr>`
					$("#table1").append(tr)
					
					
				} 
				
			})
		</script>
	</head>
	<body>
		<table id="table1" border="1px" align="center" width="80%">
			<tr>
				<td colspan="5" align="center" onclick="fun();"><h1>用户的列表</h1></td>
			</tr>
			<tr>
				<td align="center">编号</td>
				<td align="center">姓名</td>
				<td align="center">年龄</td>
				<td align="center">性别</td>
				<td align="center">操作</td>
				
			</tr>
			
			
		</table>
	</body>
</html>
